

local mt = ac.skill['冥魂重组']
mt.skill_type = 'passive'
mt.model1 = [[Abilities\Spells\Orc\Reincarnation\ReincarnationTarget.mdl]]
mt.model2 = [[Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl]]

function mt:on_add()
    local hero = self.owner
    self:gc(hero:event '单位-拦截死亡'(function(_,data)
        if not self:is_cooling() then
            self:cooling()
            local point = hero:get_point()
            local effect = point:effect{
                model = self.model1,
                angle = hero:get_facing()
            }
            hero:add_restriction '硬直'
            hero:add_restriction '隐藏'
            ac.wait(self.data1*1000,function()
                hero:remove_restriction '硬直'
                hero:remove_restriction '隐藏'
                effect:remove()
                hero:add_effect(self.model2):remove()
            end)
            data.life_rate = 100
            return true
        end
    end))
end


local mt = ac.skill['致命一击']
mt.temp = '攻击触发'
mt.model1 = [[0eb96be704f3036d2671e1531a29ba91.mdx]]
mt.odds = 25

function mt:on_run(hero,target)
    local damage = hero:get('攻击') * self.data1 / 100
    target:add_effect(self.model1):remove()
    hero:create_damage(target,damage,self)
end
